<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
		<meta charset="utf-8" />
		<meta name="_token" content="{{ csrf_token() }}"/>
		<meta name="description" content="Restyling jQuery UI Widgets and Elements" />
		<link rel="stylesheet" href="admin/assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="admin/assets/css/font-awesome.min.css" />
		<link rel="stylesheet" href="admin/assets/css/ace-fonts.css" />
		<link rel="stylesheet" href="admin/assets/css/ace.min.css" id="main-ace-style" />
		<script src="admin/assets/js/ace-extra.min.js"></script>
		<title>test</title>
	</head>
	<body style="background: #FFFFFF;">
		<div class="page-content">
			<div class="page-content-area">
				<div class="row">
					<div class="col-xs-12">
						<div class="row">
							<div class="col-xs-12">
								<table id="sample-table-1" class="table table-striped table-bordered table-hover">
									<thead>
										<tr>
											<th class="center"><label class="position-relative">
												<input type="checkbox" class="ace" />
												<span class="lbl"></span> </label></th>
											<th>案例名称</th>
											<th>案例分类</th>
											<th>案例描述</th>
											<th>更新时间</th>
											<th class="hidden-480">操作</th>
										</tr>
									</thead>
									<tbody>
										@foreach ($data as $user)
										<tr>
											<td class="center">
												<label class="position-relative">
													<input type="checkbox" class="ace" />
													<span class="lbl"></span>
												</label>
											</td>
											<td>{{ $user->name }}</td>
											<td>{{ $user->catname }}</td>
											<td>{{ $user->description }}</td>
											<td>{{ $user->updated_at }}</td>
											<td>
												<div class="hidden-sm hidden-xs btn-group">
													<button class="btn btn-xs btn-success" title="" onclick="detial({{ $user->id }})">
													<i class="ace-icon fa fa-search-plus bigger-120"></i>
													</button>

													<button class="btn btn-xs btn-info" onclick="edite({{ $user->id }})">
													<i class="ace-icon fa fa-pencil bigger-120"></i>
													</button>

													<button class="btn btn-xs btn-danger" onclick="del({{ $user->id }})">
													<i class="ace-icon fa fa-trash-o bigger-120"></i>
													</button>
												</div> 
											</td>
										</tr>
										@endforeach
									</tbody>
								</table>
							</div><!-- /.span -->
						</div><!-- /.row -->
					</div>
				</div>
			</div><!-- /.page-content-area -->
		</div><!-- /.page-content -->
		{{ $data->links() }}
	</body>
	<script type="text/javascript">window.jQuery || document.write("<script src='admin/assets/js/jquery.min.js'>" + "<" + "/script>");</script>
	<script type="text/javascript">if('ontouchstart' in document.documentElement) document.write("<script src='admin/assets/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");</script>
	<script src="admin/assets/js/bootstrap.min.js"></script>

	<script src="admin/assets/js/jquery.dataTables.min.js"></script>
	<script src="admin/assets/js/jquery.dataTables.bootstrap.js"></script>

	<!-- ace scripts -->
	<script src="admin/assets/js/ace-elements.min.js"></script>
	<script src="admin/assets/js/ace.min.js"></script>
	<script>
		function del(id){
			var msg = "您真的确定要删除吗？"; 
			if (confirm(msg)==true){
				$.post("{{ url('Anliindexdel') }}",{'_token':'{{csrf_token()}}','id':id},
				function(data){
			        if(data == "ok"){
			        	alert("删除成功");location.reload();
			        }else{
			        	alert("删除失败");
			        }
			        return true;
		        });
				return true; 
			}else{ 
				return false; 
			} 
		}
	</script>
	<script>
		function detial(id){
			window.location.href="{{ url('Anliindexdetial') }}"+"?id="+id;
		}
		function edite(id){
			window.location.href="{{ url('Anliindexedite') }}"+"?id="+id;
		}
	</script>
</html>
